import Main from '_c/main/main.vue';
import BlankMain from '_c/main/BlankMan.vue';
import SSO from '_c/gwmfcsso/GwmfcSso.vue';
import config from '@/config/index'
// 不作为Main组件的子页面展示的页面单独写，如下
export const loginBaseRouter = {
    path: '/system/login',
    name: 'login_base',
    meta: {
        title: '登录'
    },
    component: () => import('@/projects/'+config.getProjectPath()+'/pages/login/login.vue')
}
export const loginRouter = {
    path: '/:tenantId/login',
    name: 'login',
    meta: {
        title: '登录'
    },
    component: () => import('@/projects/'+config.getProjectPath()+'/pages/login/login.vue')
};
export const page403 = {
    path: '/403',
    meta: {
        title: '403-权限不足'
    },
    name: 'error-403',
    component: () => import('@/projects/basic/pages/error-page/403.vue')
};
export const page404 = {
    path: '/404',
    meta: {
        title: '404-页面不存在'
    },
    name: 'error-404',
    component: () => import('@/projects/basic/pages/error-page/404.vue')
};

export const page500 = {
    path: '/500',
    meta: {
        title: '500-服务端错误'
    },
    name: 'error-500',
    component: () => import('@/projects/basic/pages/error-page/500.vue')
};

export const locking = {
    path: '/locking',
    name: 'locking',
    component: () => import('_c/main/components/lockscreen/components/locking-page.vue')
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'otherRouter',
    redirect: '/home',
    component: Main,
    meta:{
        title:'首页',icon:'ios-home'
    },
    children: [
        { path: 'home',meta: {title:'首页',icon:'ios-home'}, title: { i18n: 'home' },icon:'ios-home', name: 'home_index', component: () => import('@/projects/'+config.getProjectPath()+'/pages/home/home.vue') },
        { path: 'change-pass',meta: {title:'修改密码',icon:'ios-rose-outline'}, title: '修改密码',icon:'ios-rose-outline', name: 'change_pass', component: () => import('_c/main/components/change-pass/change-pass.vue') },
        { path: 'sub-404',meta: {title:'找不到资源',icon:'ios-close-circle'}, title: '找不到资源',icon:'ios-close-circle', name: 'sub-404', component: () => import('@/projects/basic/pages/error-page/404.vue') },
        { path: 'sub-500',meta: {title:'服务器异常',icon:'ios-close-circle'}, title: '服务器异常',icon:'ios-close-circle', name: 'sub-500', component: () => import('@/projects/basic/pages/error-page/500.vue') },
        { path: 'sub-403',meta: {title:'没有资源权限',icon:'ios-close-circle'}, title: '没有资源权限',icon:'ios-close-circle', name: 'sub-403', component: () => import('@/projects/basic/pages/error-page/403.vue') },
    ]
};

//点击链接打开浏览器tab页路径
export const dynamicLinkRouter={
    path: '/*/afsLink',
    name: 'afsLink',
    component: BlankMain,
    meta:{
        title:''
    }
}
//sso路径
export const gwmfcSSoRouter={
    path: '/sso',
    name: 'sso',
    component: SSO,
    meta:{
        title:''
    }
}

export const appRouter = [];

// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    loginRouter,
    loginBaseRouter,
    otherRouter,
    locking,
    dynamicLinkRouter,
    gwmfcSSoRouter,
    ...appRouter,
    page500,
    page403,
    page404
];
